<style src="./index.scss" lang="scss" scoped rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
import QRCode from "qrcodejs2";
export default {
    props: {
        // 使用者window实例 必定义
        appWindow: {
            type: Object,
            default: null,
        },
        value: {
            type: String,
            default: "",
        },
        size: {
            type: Number,
            default: 400,
        },
        // 二维码颜色
        colorDark: {
            type: String,
            default: "#333333",
        },
        // 二维码背景色
        colorLight: {
            type: String,
            default: "#ffffff",
        },
    },
    computed: {},
    data() {
        return {};
    },
    methods: {},
    watch: {},
    mounted() {
        this.$nextTick(() => {
        new QRCode(this.$refs.appMainCanvasQrcode, {
                text: this.value,
                width: this.size,
                height: this.size,
                colorDark: this.colorDark,
                colorLight: this.colorLight,
                correctLevel: QRCode.CorrectLevel.L, // 容错率，L/M/H
            });
      });
    },
    beforeCreate() {},
};
</script>
